<?php
namespace app\admin\validate;

use think\Validate;

class Manager extends Validate
{
    protected $rule = [
        'account'  => 'require|unique:manager',
        'password' =>'require|min:6|confirm:repassword',
        'code'=>'require|captcha',
    ];
    protected $message  =   [
        'account.require'    => '名称必须填写',
        'account.unique'     => '该名称已存在',
        'password.require'   => '密码必须填写',
        'password.min'       => '密码长度最少6位',
        'password.confirm'   => '两次密码输入不一致',  
        'code.require'=>'验证码必须填写', 
        'code.captcha'=>'验证码不正确',   
    ];
    protected $scene = [
        'save'  =>  ['account','password'],
        'update'=>  ['password'],
        'login'=>['account'=>'require','code','password'=>'require|min:6'],
    ];
}